Fix asan switch fiber with error stack info#2931
Merged
chenBright merged 3 commits intoapache:masterfrom Apr 2, 2025
Merged
Conversation
Contributor
Author
|
CC @BusyJay |
Contributor
|
LGTM |
Contributor
|
需要在环境中显式设置 detect_stack_use_after_return=1 来验证 fake_stack 是否正确构建和析构吗? |
2dbff8d to
ccca039
Compare
Contributor
Author
@BusyJay UT设置了detect_stack_use_after_return=1,后续CI都会跑。 修复了另一个问题:bthread结束后,__sanitizer_start_switch_fiber(NULL)会删除fake stack,当前bthread栈不可用了。当下一个bthread复用栈,就会出现stack use after return的问题。 修复方案:bthread栈会复用,所以即使bthread结束了,也不调__sanitizer_start_switch_fiber(NULL),保证fake stack不会被删除。bthread栈在放回池时,会被poison,可以起到stack use after return类似的检查效果。 |
Contributor
|
Cool, LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number:
Problem Summary:
#2890 调__sanitizer_start_switch_fiber时,应该传将要被调度的bthread stack信息,而不是将要挂起的bthread stack信息。
What is changed and the side effects?
Changed:
Side effects:
Performance effects(性能影响):
Breaking backward compatibility(向后兼容性):
Check List: